import { qs, axios, baseUrl } from './apiUrl'


// 登陆
export const getLogin = (params) => {
    return axios.post(`${baseUrl}/api/Login/getLogin`, params)
}

// 职能部门：添加
export const AddDept = (params) => {
    return axios.post(`${baseUrl}/api/SysDept/AddDept`, params)
}

// 职能部门：修改
export const updateDeptMessage = (params) => {
    return axios.post(`${baseUrl}/api/SysDept/updateDeptMessage`, params)
}

// 分页查询：/api/SysDept/getDeptToPage
export const getDeptToPage = (params) => {
    return axios.get(`${baseUrl}/api/SysDept/getDeptToPage`, {
        params: params
    })
}

//查询所有职能部门： 下拉liebiao
export const getAllDeptToList = (params) => {
    return axios.get(`${baseUrl}/api/SysDept/getAllDeptToList`, {
        params: params
    })
}

//根据部门id获取部门信息：：/api/SysDept/getDeptById 
export const getDeptById = (params) => {
    return axios.get(`${baseUrl}/api/SysDept/getDeptById`, {
        params: params
    })
}

// 职能部门：删除
export const DeleteDept = (params) => {
    return axios.post(`${baseUrl}/api/SysDept/DeleteDept`, params)
}


//添加城市公司：/api/SysCompany/addCompany 

export const addCompany = (params) => {
    return axios.post(`${baseUrl}/api/SysCompany/addCompany`, params)
}

//修改城市公司：/api/SysCompany/updateCompanyMessage 

export const updateCompanyMessage = (params) => {
    return axios.post(`${baseUrl}/api/SysCompany/updateCompanyMessage`, params)
}

//城市公司分页：/api/SysCompany/getCompanyToPage 

export const getCompanyToPage = (params) => {
    return axios.get(`${baseUrl}/api/SysCompany/getCompanyToPage`, {
        params: params
    })
}

//删除城市公司：/api/SysCompany/DeleteCompany

export const DeleteCompany = (params) => {
    return axios.post(`${baseUrl}/api/SysCompany/DeleteCompany`, params)
}

//查看城市公司：/api/SysCompany/getCompanyById

export const getCompanyById = (params) => {
    return axios.get(`${baseUrl}/api/SysCompany/getCompanyById`, {
        params: params
    })
}

//城市公司列表：/api/SysCompany/getAllCompanyToList 

export const getAllCompanyToList = (params) => {
    return axios.get(`${baseUrl}/api/SysCompany/getAllCompanyToList`, {
        params: params
    })
}


// /api/SysQualit/addQualit 服务质量添加   post

export const addQualit = (params) => {
    return axios.post(`${baseUrl}/api/SysQualit/addQualit`, params)
}

export const updateQualitMessage = (params) => {
    return axios.post(`${baseUrl}/api/SysQualit/updateQualitMessage`, params)
}

export const getQualitToPage = (params) => {
    return axios.get(`${baseUrl}/api/SysQualit/getQualitToPage`, {
        params: params
    })
}

export const DeleteQualit = (params) => {
    return axios.post(`${baseUrl}/api/SysQualit/DeleteQualit`, params)
}

export const getQualityById = (params) => {
    return axios.get(`${baseUrl}/api/SysQualit/getQualityById`, {
        params: params
    })
}


//5.添加核心工作：/api/SysWork/AddWork   提交方式：post

export const AddWork = (params) => {
    return axios.post(`${baseUrl}/api/SysWork/AddWork`, params)
}


//修改核心工作：/api/SysWork/updateWorkMessage   提交方式：post

export const updateWorkMessage = (params) => {
    return axios.post(`${baseUrl}/api/SysWork/updateWorkMessage`, params)
}

//核心工作分页：/api/SysWork/getWorkToPage   提交方式：get

export const getWorkToPage = (params) => {
    return axios.get(`${baseUrl}/api/SysWork/getWorkToPage`, {
        params: params
    })
}


//获取所有核心工作：/api/SysWork/getAllWorkToList   提交方式：get

export const getAllWorkToList = (params) => {
    return axios.get(`${baseUrl}/api/SysWork/getAllWorkToList`, {
        params: params
    })
}

//删除核心工作：/api/SysWork/DeleteWork   提交方式：post

export const DeleteWork = (params) => {
    return axios.post(`${baseUrl}/api/SysWork/DeleteWork`, params)
}

//根据核心工作id获取内容：/api/SysWork/getSysWorkById  提交方式：get

export const getSysWorkById = (params) => {
    return axios.get(`${baseUrl}/api/SysWork/getSysWorkById`, {
        params: params
    })
}
//***************** */
//添加互评问题：/api/EvaluationConfig/addEvaluationConfig  
export const addEvaluationConfig = (params) => {
    return axios.post(`${baseUrl}/api/EvaluationConfig/addEvaluationConfig`, params)
}

//修改互评问题：/api/EvaluationConfig/updateEvaluationConfigMessage
export const updateEvaluationConfigMessage = (params) => {
    return axios.post(`${baseUrl}/api/EvaluationConfig/updateEvaluationConfigMessage`, params)
}

//分页：/api/EvaluationConfig/getEvaluationConfigToPage  提交方式：get
export const getEvaluationConfigToPage = (params) => {
    return axios.get(`${baseUrl}/api/EvaluationConfig/getEvaluationConfigToPage`, {
        params: params
    })
}

//获取所有问题：/api/EvaluationConfig/getAllEvaluationConfigToList  
export const getAllEvaluationConfigToList = (params) => {
    return axios.get(`${baseUrl}/api/EvaluationConfig/getAllEvaluationConfigToList`, {
        params: params
    })
}

//删除：/api/EvaluationConfig/DeleteEvaluationConfig  提交方式：post
export const DeleteEvaluationConfig = (params) => {
    return axios.post(`${baseUrl}/api/EvaluationConfig/DeleteEvaluationConfig`, params)
}

//根据id获取问卷信息：/api/EvaluationConfig/getEvaluationConfigById 
export const getEvaluationConfigById = (params) => {
    return axios.get(`${baseUrl}/api/EvaluationConfig/getEvaluationConfigById`, {
        params: params
    })
}
/****************** */

//4.人员管理：添加人员：/api/SysUser/addUser   提交方式：post  

export const addUser = (params) => {
    return axios.post(`${baseUrl}/api/SysUser/addUser`, params)
}

// 修改人员密码：/api/SysUser/updateUserPassWord

export const updateUserPassWord = (params) => {
    return axios.post(`${baseUrl}/api/SysUser/updateUserPassWord`, params)
}

//修改人员信息：/api/SysUser/updateUserMessage   提交方式：post

export const updateUserMessage = (params) => {
    return axios.post(`${baseUrl}/api/SysUser/updateUserMessage`, params)
}


//人员分页：/api/SysUser/getUserToPage  提交方式：get

export const getUserToPage = (params) => {
    return axios.get(`${baseUrl}/api/SysUser/getUserToPage`, {
        params: params
    })
}


//获取所有非管理员用户：/api/SysUser/getAllUserToList  提交方式：get

export const getAllUserToList = (params) => {
    return axios.get(`${baseUrl}/api/SysUser/getAllUserToList`, {
        params: params
    })
}

//删除用户：/api/SysUser/DeleteUser  提交方式：post

export const DeleteUser = (params) => {
    return axios.post(`${baseUrl}/api/SysUser/DeleteUser`, params)
}

//根据部门id获取人员信息： /api/SysUser/getUserByDeptId  提交方式：get
export const getUserByDeptId = (params) => {
    return axios.get(`${baseUrl}/api/SysUser/getUserByDeptId`, {
        params: params
    })
}

//根据用户id获取用户信息：/api/SysUser/getUserByUserId   提交方式：get

export const getUserByUserId = (params) => {
    return axios.get(`${baseUrl}/api/SysUser/getUserByUserId`, {
        params: params
    })
}

/********/

// 小组测评分页：getGroupConfigToPage   
export const getGroupConfigToPage = (params) => {
    return axios.get(`${baseUrl}/api/GroupConfig/getGroupConfigToPage`, {
        params: params
    })
}

// 获取所有小组测评：getAllGroupConfigToList  

export const getAllGroupConfigToList = (params) => {
    return axios.get(`${baseUrl}/api/GroupConfig/getAllGroupConfigToList`, {
        params: params
    })
}

// 删除小组测评：DeleteGroupConfig   

export const DeleteGroupConfig = (params) => {
    return axios.post(`${baseUrl}/api/GroupConfig/DeleteGroupConfig`, params)
}

// 根据小组测评获取详细信息：getEvaluationConfigById

export const getEvaluationConfigByIds = (params) => {
    return axios.get(`${baseUrl}/api/GroupConfig/getEvaluationConfigById`, {
        params: params
    })
}

//7.添加小组配置   /api/GroupConfig/addGroupConfig   提交方式：post

export const addGroupConfig = (params) => {
    return axios.post(`${baseUrl}/api/GroupConfig/addGroupConfig`, params)
}

//修改小组配置：/api/GroupConfig/updateCompanyMessage  提交方式：post
export const updateGroupConfig = (params) => {
    return axios.post(`${baseUrl}/api/GroupConfig/updateGroupConfig`, params)
}


//*****************/


// /api/SysQuestion/addSysQuestion   
export const addSysQuestion = (params) => {
    return axios.post(`${baseUrl}/api/SysQuestion/addSysQuestion`, params)
}

// /api/SysQuestion/updateSysQuestionMessage

export const updateSysQuestionMessage = (params) => {
    return axios.post(`${baseUrl}/api/SysQuestion/updateSysQuestionMessage`, params)
}

///api/SysQuestion/getSysQuestionToPage 

export const getSysQuestionToPage = (params) => {
    return axios.get(`${baseUrl}/api/SysQuestion/getSysQuestionToPage`, { params: params })
}


///api/SysQuestion/getAllSysQuestionToList     questionTypeId

export const getAllSysQuestionToList = (params) => {
    return axios.get(`${baseUrl}/api/SysQuestion/getAllSysQuestionToList`, { params: params })
}

///api/SysQuestion/DeleteSysQuestion   id

export const DeleteSysQuestion = (params) => {
    return axios.post(`${baseUrl}/api/SysQuestion/DeleteSysQuestion`, params)
}

///api/SysQuestion/getSysQuestionById   questionId

export const getSysQuestionById = (params) => {
    return axios.get(`${baseUrl}/api/SysQuestion/getSysQuestionById`, { params: params })
}

///api/SysQuestion/releaseQuestion   questionId

export const releaseQuestion = (params) => {
    return axios.get(`${baseUrl}/api/SysQuestion/releaseQuestion`, { params: params })
}


//getQuestionHistoryById

export const getQuestionHistoryById = (params) => {
    return axios.get(`${baseUrl}/api/SysQuestion/getQuestionHistoryById`, { params: params })
}


///api/SysDictionaries/getDictionariesByType   参数：type  （问卷类型：questionType   评价类型：evaluateType）

export const getDictionariesByType = (params) => {
    return axios.get(`${baseUrl}/api/SysDictionaries/getDictionariesByType`, { params: params })
}

///api/QuestionHistory/DataToExcel

// export const DataToExcel = (params) => {
//     return axios.get(`${baseUrl}/api/QuestionHistory/DataToExcel`, { params: params }, { responseType: 'blob' })
// }

// 文件导出
export const DataToExcel = (params) => {
    return axios({
      method: 'get',
      url: `${baseUrl}/api/QuestionHistory/DataToExcel`,
      params: params,
      responseType: 'blob',
      headers: {
      }
    });
  };

  export const DataToExcelMx = (params) =>{
      return axios({
          method: 'get',
          url: `${baseUrl}/api/SysQuestion/DataToExcelMx`,
          params: params,
          responseType: 'blob',
          headers: {
      }
      });
  };



///api/QuestionHistory/getQuestionHistoryToPage  分页查询  name  pageIndex  pageSize
export const getQuestionHistoryToPage = (params) => {
    return axios.get(`${baseUrl}/api/QuestionHistory/getQuestionHistoryToPage`, { params: params })
}

///api/QuestionHistory/getHistoryDetailByQuestionId   questionId  获取详细信息
export const getHistoryDetailByQuestionId = (params) => {
    return axios.get(`${baseUrl}/api/QuestionHistory/getHistoryDetailByQuestionId`, { params: params })
}

///api/QuestionHistory/UpdateHistoryDetail  问卷答题   isCommit  N 暂存  isCommit  Y 提交
export const UpdateHistoryDetail = (params) => {
    return axios.post(`${baseUrl}/api/QuestionHistory/UpdateHistoryDetail`, params)
}












